{*
 * @author 		Zprofess <contact@zprofess.com>
 * @copyright  	2011 Zprofess
 * @version  	1.0 
 * @license    http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 *}
 
{if $criterions|@count gt 0}
	<div class="average_total">
		<b>{l s='Average Ratings' mod='reviewratingsynthesis'}: ({$averageTotal}/{$zproNumber})</b>
		<div style="float:left;">
			<div class="displayAverageZprofess"></div>
		</div>
		<script type="text/javascript">
			$(".displayAverageZprofess").raty({									
				width: 			{$configRating['width']},
				cancel: 		{$configRating['cancel']},						
				cancelHint:   	"{$configRating['cancelHint']}",  
				cancelOff:  	"{$configRating['cancelOff']}",
				cancelOn:   	"{$configRating['cancelOn']}", 	
				cancelPlace:  	"{$configRating['cancelPlace']}", 
			
				half:  			true,
				space:       	false,
				hintList:		{$configRating['hintList']},
				noRatedMsg:		"{$configRating['noRatedMsg']}",
				number:     	{$configRating['number']},
				path:           "{$configRating['path']}",	
				starHalf:		"{$configRating['starHalf']}",
				starOff:		"{$configRating['starOff']}",
				starOn:			"{$configRating['starOn']}",
				readOnly:		true,
				start: 			{$averageTotal},
			});
			function zavgcustomer_review(id) {
				$('#idTabReviewsZprofess').click ();
				$.scrollTo('#idTabReviews', 1200 );
			}
		</script>
		( <a style="float:left; margin-left:2px;" href="#" onclick="zavgcustomer_review();" id="zcustomer_reviews" class="zcustomer_reviews" >
			{$nbReviews}{l s=' Reviews' mod='reviewratingsynthesis'}
		</a> )
	</div>
	<br style="clear: both;" />
	{foreach from=$criterions item=criterion}
		<div class="average">
			{foreach from=$averages key=k item=average}
				{if ({$criterion.id_zproduct_criterion} == {$k})}
					<b> {$criterion.name|escape:'html':'UTF-8'}: ({$average|string_format:"%.1f"}) </b>
					<div id="avg-raty-{$k}" class="displayAverageZprofess_{$k}"></div>
					<script type="text/javascript">
						$(".displayAverageZprofess_{$k}").raty({									
							width: 			{$configRating['width']},
							cancel: 		{$configRating['cancel']},						
							cancelHint:   	"{$configRating['cancelHint']}",  
							cancelOff:  	"{$configRating['cancelOff']}",
							cancelOn:   	"{$configRating['cancelOn']}", 	
							cancelPlace:  	"{$configRating['cancelPlace']}", 
						
							half:  			true,
							space:       	false,
							hintList:		{$configRating['hintList']},
							noRatedMsg:		"{$configRating['noRatedMsg']}",
							number:     	{$configRating['number']},
							path:           "{$configRating['path']}",	
							starHalf:		"{$configRating['starHalf']}",
							starOff:		"{$configRating['starOff']}",
							starOn:			"{$configRating['starOn']}",
							readOnly:		true,
							start: 			{$average},
						});
					</script>
				{/if}
			{/foreach}
		</div>
	{/foreach}
{/if}